package com.sctvcloud.dongqu.beans;

import android.support.annotation.NonNull;
import android.text.TextUtils;

import com.ruihang.generalibrary.ui.util.IListData;
import com.sctvcloud.dongqu.ui.datainf.ILiveHomeItem;
import com.sctvcloud.dongqu.ui.util.IListShowData;

import java.io.Serializable;
import java.sql.Date;

/**
 * 首页直播栏目的列表的item的data类
 * Created by liuyu on 2017/7/13.
 */

public class LiveItem implements ILiveHomeItem, Serializable {

    private static final long serialVersionUID = 511002234444831796L;
    /**
     * 直播id
     */
    private String liveId;
    /**
     * 直播标题
     */
    private String liveTitle;
    private String liveTime;
    private String channelName;
    /**
     * 直播封面图
     */
    private String liveImage;
    /**
     * 直播VideoUrl
     */
    private String liveUrl;

    private String livePlayUrl;
    /**
     * 直播来源
     */
    private String liveSource;
    /**
     * 直播详情跳转url
     */
    private String liveContentUrl;
    private boolean isliving;

    private Date timeTemp;

    private boolean hasMore = false;

    private int viewType = 3;

    private boolean isMute = false;//是否静音播放

    @Override
    public String getDataTitle() {
        return liveTitle;
    }

    @Override
    public String getDataImg() {
        return liveImage;
    }

    @Override
    public String getDataTag() {
        return channelName;
    }

    @Override
    public int getDataType() {
        return 0;
    }

    @Override
    public int getDataViewType() {
        return viewType;
    }

    @Override
    public IListData getOwner() {
        return null;
    }

    @Override
    public Date getDataDate() {
        return timeTemp;
    }

    @Override
    public void setDataDate(Date date) {
        this.timeTemp = date;
    }

    @NonNull
    @Override
    public String getDatePattern() {
        return "yyyy-MM-dd HH:mm:ss";
    }

    @Override
    public String getDateString() {
        return liveTime;
    }

    @Override
    public String getDataId() {
        return liveId;
    }

    @Override
    public String getTime() {
        return liveTime;
    }

    @Override
    public IListShowData getOwenerData() {
        return null;
    }

    @Override
    public boolean isLiving() {
        return isliving;
    }

    public String getTitle() {
        return liveTitle;
    }

    public void setTitle(String title) {
        this.liveTitle = title;
    }

    public String getLiveTime() {
        return liveTime;
    }

    public void setLiveTime(String liveTime) {
        if (TextUtils.equals(liveTime, this.liveTime)) {
            timeTemp = null;
        }
        this.liveTime = liveTime;
    }

    public String getLiveUrl() {
        return liveUrl;
    }

    public void setLiveUrl(String playUrl) {
        this.liveUrl = playUrl;
    }

    public String getChannelName() {
        return channelName;
    }

    public void setChannelName(String channelName) {
        this.channelName = channelName;
    }

    public String getLiveImg() {
        return liveImage;
    }

    public void setLiveImg(String img) {
        this.liveImage = img;
    }

    public void setLiving(boolean living) {
        isliving = living;
    }

    public Date getTimeTemp() {
        return timeTemp;
    }

    public void setTimeTemp(Date timeTemp) {
        this.timeTemp = timeTemp;
    }

    public int getViewType() {
        return viewType;
    }

    public void setViewType(int viewType) {
        this.viewType = viewType;
    }

    public String getLiveId() {
        return liveId;
    }

    public void setLiveId(String liveId) {
        this.liveId = liveId;
    }

    public String getLiveSource() {
        return liveSource;
    }

    public void setLiveSource(String liveSource) {
        this.liveSource = liveSource;
    }

    public String getLiveContentUrl() {
        return liveContentUrl;
    }

    public void setLiveContentUrl(String liveContentUrl) {
        this.liveContentUrl = liveContentUrl;
    }

    public boolean isHasMore() {
        return hasMore;
    }

    public void setHasMore(boolean hasMore) {
        this.hasMore = hasMore;
    }

    public String getLivePlayUrl() {
        return livePlayUrl;
    }

    public void setLivePlayUrl(String livePlayUrl) {
        this.livePlayUrl = livePlayUrl;
    }

    public boolean isMute() {
        return isMute;
    }

    public void setMute(boolean mute) {
        isMute = mute;
    }
}
